<?php
/* $Id: example.php 3 2012-04-15 11:43:40Z lukas.slansky@gmail.com $ */

require_once('LSCache.php');
$cache = new LSCache('testCache', dirname('/tmp/cache'));
$test = $cache->get('testKey');
if ($test) {
    echo "Got cached value: " . $test->getValue();
    if ($test->isExpired()) {
        echo "...however it is expired\n";
    } else {
        echo "...and it is valid\n";
        exit;
    }
}
echo "Setting new value\n";
$cache->put('testKey', 'testValue');